{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from llama_index.llms.ollama import Ollama\n",
    "\n",
    "llm = Ollama(model=\"gemma\", request_timeout=30.0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Harry Potter is a beloved fantasy novel series written by J.K. Rowling. The story follows the journey of Harry Potter, an orphaned boy who discovers on his eleventh birthday that he is a wizard. He is invited to Hogwarts School of Witchcraft and Wizardry, where he meets his best friends, Ron Weasley and Hermione Granger.\n",
      "\n",
      "**The story:**\n",
      "\n",
      "* **The Boy Who Lived:** The first book, \"Harry Potter and the Sorcerer's Stone,\" tells the story of Harry's first year at Hogwarts. He learns about his magical abilities, makes new friends, and faces a mysterious villain named Voldemort.\n",
      "* **The Prisoner of Azkaban:** The second book, \"Harry Potter and the Prisoner of Azkaban,\" explores themes of justice and innocence.\n",
      "* **The Order of the Phoenix:** The third book, \"Harry Potter and the Order of the Phoenix,\" introduces the concept of the Order of the Phoenix, a secret society fighting against Voldemort.\n",
      "* **The Half-Blood Prince:** The fourth book, \"Harry Potter and the Half-Blood Prince,\" introduces a mysterious new teacher and explores themes of prejudice and identity.\n",
      "* **Deathly Hallows:** The seventh book, \"Harry Potter and the Deathly Hallows,\" brings the story to a close, with a final battle against Voldemort and the defeat of evil.\n",
      "\n",
      "**The characters:**\n",
      "\n",
      "* **Harry Potter:** The protagonist, a young orphan who discovers he is a wizard. He is brave, loyal, and always willing to fight for what he believes is right.\n",
      "* **Ron Weasley:** Harry's best friend, a goofy but lovable wizard who is known for his humor and unwavering loyalty.\n",
      "* **Hermione Granger:** Harry's other best friend, a brilliant witch with a sharp mind and a strong moral compass.\n",
      "* **Voldemort:** The main antagonist, a dark wizard who seeks to establish his power and control.\n",
      "* **Albus Dumbledore:** The headmaster of Hogwarts, a powerful and enigmatic figure.\n",
      "\n",
      "**The impact:**\n",
      "\n",
      "The Harry Potter series has been a global phenomenon, selling millions of copies worldwide. It has been adapted into numerous films, and the characters have become household names. The story has also inspired countless other writers and artists.\n",
      "\n",
      "**Overall, Harry Potter is a captivating story about love, friendship, and the power of good against evil.**\n"
     ]
    }
   ],
   "source": [
    "query = \"tell me about harry potter\"\n",
    "\n",
    "external_response = llm.complete(query)\n",
    "print(external_response)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".venv",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
